using System.Runtime.CompilerServices;

namespace System.Utility
{
	public interface IAsyncResult
	{
		double Completed
		{
			get;
		}

		bool IsCompleted
		{
			get;
		}

		bool IsSuccess
		{
			get;
			set;
		}

		string Log
		{
			get;
			set;
		}

		string Message
		{
			get;
			set;
		}

		AdvanceEventHandler OnAdvance
		{
			get;
			set;
		}

		Action OnCompleted
		{
			get;
			set;
		}

		double Percent
		{
			get;
		}

		double Total
		{
			get;
		}

		[MethodImpl(MethodImplOptions.Synchronized)]
		void Advance(double work, string message = "", object sender = null);

		[MethodImpl(MethodImplOptions.Synchronized)]
		void AdvanceCompleted(double completed, string message = "");

		[MethodImpl(MethodImplOptions.Synchronized)]
		void Start(double total);

		void Stop();

		void WriteMessage(string mes);
	}
}